<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>layui</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="${base}/static/flow/lib/layui/css/layui.css"  media="all">
    <!-- 注意：如果你直接复制所有代码到本地，上述css路径需要改成你本地的 -->
</head>
<body>
<div style="margin-bottom: 5px;">

    <!-- 示例-970 -->
    <ins class="adsbygoogle" style="display:inline-block;width:970px;height:20px" data-ad-client="ca-pub-6111334333458862" data-ad-slot="3820120620"></ins>

</div>

<div class="layui-btn-group demoTable">
    <button class="layui-btn layui-btn-normal" data-type="isAll" onclick="WeAdminShow('添加景点','${base}/flowlight/addjingdian.htm',1000,600)">添加景点</button>
</div>

<table class="layui-table" style="width: 95%">
    <colgroup>
        <col width="150">
        <col width="200">
        <col>
    </colgroup>
    <thead>
    <tr>
        <th>景点名称</th>
        <th>景点标题</th>
        <th>景点内容</th>
        <th>景点历史</th>
        <th>图片</th>
        <th>操作</th>

    </tr>
    </thead>
    <tbody>

    <#list ScennicList as Scennic>
        <tr>
            <td>${Scennic.scennicName}</td>
            <td>${Scennic.scennicTitle}</td>
            <td>${Scennic.scennicContent}</td>
            <td>${Scennic.scennicHistory}</td>
            <td>${Scennic.scennicImg}</td>
            <td>
                <a href="${base}/flowlight/addjingdianPic.htm?scennicId=${Scennic.scennicId}" class="layui-btn layui-btn-normal">查看图片</a>
            </td>
        </tr>
    </#list>
    </tbody>
</table>

<script type="text/html" id="barDemo">
    <a class="layui-btn layui-btn-primary layui-btn-xs" lay-event="detail">查看</a>
    <a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a>
    <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a>
</script>


<script src="${base}/static/flow/lib/layui/layui.js" charset="utf-8"></script>
<script src="${base}/static/flow/static/js/admin.js" type="text/javascript" charset="utf-8"></script>
<!-- 注意：如果你直接复制所有代码到本地，上述js路径需要改成你本地的 -->
<script>
    layui.use('table', function(){
        var table = layui.table;
        //监听表格复选框选择
        table.on('checkbox(demo)', function(obj){
            console.log(obj)
        });


        //监听工具条
        table.on('tool(demo)', function(obj){
            var data = obj.data;
            if(obj.event === 'detail'){
                layer.msg('ID：'+ data.id + ' 的查看操作');
            } else if(obj.event === 'del'){
                layer.confirm('真的删除行么', function(index){
                    obj.del();
                    layer.close(index);
                });
            } else if(obj.event === 'edit'){
                layer.alert('编辑行：<br>'+ JSON.stringify(data))
            }
        });

        var $ = layui.$, active = {
            isAll: function(){ //验证是否全选
                var checkStatus = table.checkStatus('idTest');
//                layer.msg(checkStatus.isAll ? '全选': '未全选')
            }
        };

        $('.demoTable .layui-btn').on('click', function(){
            var type = $(this).data('type');
            active[type] ? active[type].call(this) : '';
        });
    });
</script>

</body>
</html>